package com.zfl;

import java.util.ArrayList;
import java.util.List;

public class Traversal {
    
    private int count=0;
    private int max;
    
    public static void main(String[] args) {
        TreeNode node3 = new TreeNode(3);
        TreeNode node2 = new TreeNode(2, node3, null);
        TreeNode node1 = new TreeNode(1, null, node2);
        TreeNode root = node1;
        List<Integer> list = new Traversal().inorderTraversal(root);
        System.out.println("list = " + list);
    }

    public List<Integer> inorderTraversal(TreeNode root) {
        ArrayList<Integer> list = new ArrayList<>();
        this.inorder(root,list);
        System.out.println("this.max = " + this.max);
        return list;
    }

    private void inorder(TreeNode root,List<Integer> list)  {
        if (root==null) {
            return;
        }
//        count++;
//        max = Math.max(max,count);


        inorder(root.left,list);
        inorder(root.right,list);

//        count--;

    }
}
